package cn.tedu.tourism.province.controller;

import cn.tedu.tourism.base.response.JsonResult;
import cn.tedu.tourism.province.pojo.dto.ProvinceQuery;
import cn.tedu.tourism.province.pojo.entity.Province;
import cn.tedu.tourism.province.pojo.vo.ProvinceVO;
import cn.tedu.tourism.province.service.ProvinceService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("/province")
@Api("省份模块")
public class ProvinceController {
    @Autowired
    private ProvinceService provinceService;
    @GetMapping("/select")
    public JsonResult selectProvince(ProvinceQuery provinceQuery){
        log.debug("省份参数为：{}",provinceQuery);
        List<ProvinceVO> provinceVOS = provinceService.select(provinceQuery);
        return JsonResult.ok(provinceVOS);
    }
}
